package com.github.thinwonton.spring.source.analysis;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.config.BeanPostProcessor;

public class BeanPostProcessorTestBean implements BeanPostProcessor, InitializingBean {

    public BeanPostProcessorTestBean() {
        System.out.println("BeanPostProcessorTestBean constructor");
    }

    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("BeanPostProcessorTestBean postProcessBeforeInitialization");
        return bean;
    }

    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("BeanPostProcessorTestBean postProcessAfterInitialization");
        return bean;
    }

    public void afterPropertiesSet() throws Exception {
        System.out.println("BeanPostProcessorTestBean afterPropertiesSet");
    }

}
